﻿using BCEntity.Common.FAQ;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Common.FAQ
{
    public interface IFaqData
    {
        /// <summary>
        /// 查询常见问题列表（分页）
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        /// <param name="title">常见问题标题</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="ascending">排序</param>
        /// <param name="fromSim">来自后台查询</param>
        /// <param name="dataCount">数据总数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        IEnumerable<FAQEntity> QueryFAQ(long? faqId, string title, string keyWord, DateTime? start, DateTime? end, bool? ascending, bool fromSim, out int dataCount, int pageIndex = 1, int pageSize = 10);
        /// <summary>
        /// 新增常见问题
        /// </summary>
        /// <param name="title">常见问题标题</param>
        /// <param name="question">常见问题描述</param>
        /// <param name="replyEmail">回复邮箱</param>
        /// <returns></returns>
        FAQEntity NewAdd(string title, string question, string replyEmail);
        /// <summary>
        /// 管理员回复
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        /// <param name="answer">回复内容</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="adminId">回复管理员ID</param>
        /// <param name="adminFullName">回复管理员名称</param>
        /// <returns></returns>
        FAQEntity ModifyReply(long faqId, string answer, string keyWord, long adminId, string adminFullName);
        /// <summary>
        /// 修改是否显示
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        /// <param name="isShow">是否显示</param>
        /// <returns></returns>
        FAQEntity ModifyIsShow(long faqId, bool isShow);
        /// <summary>
        /// 删除常见问题
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        /// <returns></returns>
        bool ModifyIsDelete(long faqId);
        /// <summary>
        /// 查询特定数量的常见问题
        /// </summary>
        /// <param name="index"></param>
        /// <param name="amount"></param>
        /// <param name="dataCount"></param>
        /// <returns></returns>
        IEnumerable<FAQEntity> QuerySpecify(int index, int amount);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        Task<bool> Exists(long faqId);
        /// <summary>
        /// 启用常见问题ID
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        Task<bool> Enabled(long faqId);
        /// <summary>
        /// 禁用常见问题ID
        /// </summary>
        /// <param name="faqId">常见问题ID</param>
        Task<bool> Disabled(long faqId);
    }
}
